{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Courier New;}{\f1\froman\fprq2\fcharset0 Times New Roman;}}
\viewkind4\uc1\pard\f0\fs20 PROGRAM 11             !PIA (U5) Test \par
\par
   DPY-PIA TEST <U5>#\par
   SYNC ADDRESS\par
   EXECUTE PROGRAM 12                 !delay\par
   DPY-+2-CONT#\par
   STOP\par
   REG1 = 0                         !test number clear\par
\par
1: LABEL 1 \par
   INC REG1                         !increment test number\par
   REG3 = 0                         !clear bit number\par
   IF REG1 = 6 GOTO F               \par
IF REG1 = 5 GOTO 7                  !which test is next?\par
IF REG1 = 4 GOTO 4 \par
IF REG1 = 3 GOTO 3 \par
IF REG1 = 2 GOTO 2\par
DPY-#TEST PORT A OUTPUT \par
EXECUTE PROGRAM 12                  !delay\par
DPY-TESTER PULSE HIGH, LOW OUT-\par
DPY-+CONT#\par
STOP\par
WRITE @ 100C1 = 0\par
WRITE @ REGF DEC = FF                !pia port a to output Part of\par
WRITE @ REGF INC = 4                                       Test 1\par
REG2 = 2                             !1st pia pin number\par
REG6 = A00                           !expected signature\par
REGF = 100C0                         !pia port a address\par
GOTO 5\par
\par
2: LABEL 2\par
   DPY-#TEST PORT B OUTPUT\par
   EXECUTE PROGRAM 12\par
   WRITE @ 100C3 = 0\par
   WRITE @ REGF DEC = FF             !pia port b to output  Part of\par
   WRITE @ REGF INC = 4                                     Test 2\par
   REG2 = 10                         !enter 1st pia pin number\par
   REG6 = A00                        !expected signature\par
   REGF = 100C2                      !pia port b address\par
   GOTO 5\par
\par
3: LABEL 3\par
   DPY-TEST PORT A INPUT#\par
   EXECUTE PROGRAM 12\par
   WRITE @ 100C1 = 0                 !PIA port a to input    Part of\par
   WRITE @ REGF DEC = 0                                      Test 3\par
   WRITE @ REGF INC = 4\par
   DPY-TESTER PULSE HIGH, LOW IN-\par
   DPY-+CONT#\par
   STOP\par
   REG2 = 2                          !1st pia pin number\par
   REG6 = 1                          !expected signature\par
   REGF = 100C0                      !port a address\par
   GOTO 5\par
\par
4: LABEL 4\par
DPY-TEST PORT B INPUT#\par
EXECUTE PROGRAM 12\par
WRITE @ 100C3 = 0                                      ! Part of\par
WRITE @ REGF DEC = 0               !pia port b to input! Test 4\par
WRITE @ REGF INC = 4\par
REG2 = 101                         !st pia pin number\par
REG6 = 1                           !expected signature\par
REGF = 100C2                       !port b address\par
\par
5: LABEL 5\par
DPY-PR0BE U22 PIN $2               !does oper wish to probe current pia pin?\par
DPY-+, YES/NO #?7\par
IF REG7 = 0 GOTO D                 !no - increment pin and bit number\par
READ PROBE                         !yes - read probe\par
IF REG1 = 5 GOTO 8                 !if test 4 complete, check cb2 line\par
IF REG1 > 2 GOTO 6                 !if test 2 complete, continue with test 3, or 4\par
WRITE @ REGF = 0                   !sets pia port to 0\par
DTOG @ REGF = FF BIT REG3          !toggle the bit no. in reg. 3 Part of Test 1 and 2\par
DTOG @ REGF = REGE BIT REGD        !repeat toggle using default reg.\par
WRITE @ REGF = 0                   !pia to zero\par
READ PROBE                         !gather signature\par
IF REG0 AND FFFF00 = REG6 GOTO C   !mask off all but sig and check against reg. 6\par
GOTO E\par
\par
6: LABEL 6\par
READ @ REGF                        !read pulse at pia port                    !Part\par
REG8 = REGE                        !save data                                 !of\par
READ @ REGF                             !read pulse at pia port               !Test\par
IF REG8 AND REG6 = REGE AND REG6 GOTO E !if pulse present at each read, error !3 and 4\par
SHL REG6                                !move the test bit to next position for next pia pin check\par
GOTO C\par
\par
7: LABEL 7\par
DPY-#CB2 TEST\par
EXECUTE PROGRAM 12\par
DPY-TESTER PULSE HIGH, LOW OUT\-\par
DPY-+CONT#\par
STOP\par
REG2 = 19                           !cb2 pin no.\par
REG3 = 7                            !full count in bit counter\par
REG6 = 2                            !expected event count\par
GOTO 5\par
\par
8: LABEL 8\par
WRITE @ 100C3 = 38\par
WRITE @ REGF = 30                   !stimulate cb2 line\par
WRITE @ REGF = 38\par
WRITE @ REGF = 30\par
READ PROBE                          !gather event count\par
IF REG0 AND 7F = REG6 GOTO C        !verity event count - o.k. goto a\par
GOTO E                              !not correct count - goto e\par
\par
C: LABEL C                          !sig o.k.\par
DPY-+, GOOD\par
EXECUTE PROGRAM 12                  !delay\par
\par
D: LABEL D\par
INC REG2                            !increment pin\par
INC REG3                            !increment bit\par
IF REG3 = 8 GOTO 1\par
GOTO 5\par
\par
E: LABEL E                          !sig. failure\par
DPY-'U22 PIN $2 BIT $3 FAILURE\par
DPY-+ LOOP'?5                       !repeat test\par
IF REG5 = 1 GOTO 5                  !yes\par
DPY-TEST FAIL#\par
STOP\par
\par
F: LABEL F\par
DPY-PIA TEST PASSED#\par
\par
\f1\par
}
